<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <script>
    window.addEventListener('load', function () {
      var btn = document.querySelector('button');
      btn.addEventListener('click', function () {
        alert('button clicked');
      })
    })
    window.addEventListener('load', function () {
      alert('load 触发');
    })
    window.addEventListener('DOMContentLoaded', function () {
      alert('DOMContentLoaded 触发');
    })
    // alert DOMContentLoaded 触发 => alert load触发 => 点击按钮 => alert button clicked
  </script>
</head>
<body>
<button>click</button>
</body>
</html>